﻿using CRUD_ADO.Net.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CRUD_ADO.Net.DAO;

namespace CRUD_ADO.Net.BUS
{
    public class BUSdemo
    {
        private DAODemo dao;
        public bool insertCustomer(string CustomerID, string CompanyName, string ContactName, string Address, string Phone)
        {
            dao = new DAODemo();
            Customer customer = new Customer()
            {
                CustomerID1 = CustomerID,
                CompanyName1 = CompanyName,
                ContactName1 = ContactName,
                Address1 = Address,
                Phone1 = Phone
            };

            return dao.insertData(customer);
        }
        public bool deleteCustomer(string customerId)
        {
            dao = new DAODemo();

            return dao.deleteData(customerId);
        }
        public bool updateCustomer(string CustomerID, string CompanyName, string ContactName, string Address, string Phone)
        {
            dao = new DAODemo();
            Customer customer = new Customer()
            {
                CustomerID1 = CustomerID,
                CompanyName1 = CompanyName,
                ContactName1 = ContactName,
                Address1 = Address,
                Phone1 = Phone
            };

            return dao.updateData(customer);
        }
    }
}